package com.example.demo.mapper;

import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2023-03-02
 * Time: 17:34
 */

@Mapper //代表是myBatis的操作接口
public interface UserMapper {

    //查询所有信息
    public List<UserInfo> getAll();

    //根据id查询信息
    public UserInfo getUserById(@Param("uid") Integer id);

    //根据姓名查询信息
    public UserInfo getUserByName(@Param("username")String username);

    //模糊查询
    public UserInfo getUserByLike(@Param("username")String username);

    //动态插入
    public int add(@Param("username")String username,
                   @Param("password")String password,
                   @Param("photo")String photo);
    //多条信息删除
    public int delByIds(List<Integer> ids);
}
